package com.example.human_resource_management.entry.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 培训表
 * @TableName training
 */
@TableName(value ="training")
@Data
public class Training {
    /**
     * 唯一标识培训
     */
    @TableId(type = IdType.AUTO)
    private Long trainId;

    /**
     * 培训名称
     */
    private String trainName;

    /**
     * 培训内容
     */
    private String content;

    /**
     * 培训时间
     */
    private Date trainTime;

    /**
     * 培训地点
     */
    private String location;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Training other = (Training) that;
        return (this.getTrainId() == null ? other.getTrainId() == null : this.getTrainId().equals(other.getTrainId()))
            && (this.getTrainName() == null ? other.getTrainName() == null : this.getTrainName().equals(other.getTrainName()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getTrainTime() == null ? other.getTrainTime() == null : this.getTrainTime().equals(other.getTrainTime()))
            && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTrainId() == null) ? 0 : getTrainId().hashCode());
        result = prime * result + ((getTrainName() == null) ? 0 : getTrainName().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getTrainTime() == null) ? 0 : getTrainTime().hashCode());
        result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", trainId=").append(trainId);
        sb.append(", trainName=").append(trainName);
        sb.append(", content=").append(content);
        sb.append(", trainTime=").append(trainTime);
        sb.append(", location=").append(location);
        sb.append("]");
        return sb.toString();
    }
}